﻿<%@ Page Title="Handle empty list" Language="C#" MasterPageFile="~/Demo.master" Inherits="DemoPage"
    StylesheetTheme="start" %>

<%@ Register Src="~/CodeFormatter.ascx" TagName="Code" TagPrefix="demo" %>

<script runat="server">
    protected void Page_Load(object sender, EventArgs e)
    {
        DataBind();
    }
</script>

<asp:Content ID="Content1" ContentPlaceHolderID="DemoHolder" runat="Server">
    <div class="dna-state-help ui-corner-all" style="margin-bottom: 10px;">
        Prevent all items in a list from being dropped into a separate, empty list using
        the <b>AllowDropOnEmpty</b> property set to false. By default, sortable items can
        be dropped on empty lists.
    </div>
    <br />
    <style type="text/css">
        .sortable { list-style-type: none; margin: 0; padding: 0; padding-top: 3px; width: 30%;float:left;margin:5px; }
        .sortable li { margin: 0 3px 3px 3px; padding: 0.4em; padding-left: 1.5em; font-size: 9pt; height: 18px; }
        .sortable li span { position: absolute; margin-left: -1.3em; }
    </style>
    <DotNetAge:SimpleListView ID="SimpleListView1" runat="server" CssClass="ui-helper-reset ui-widget-content sortable ui-corner-all"
        ItemCssClass="ui-helper-reset ui-state-default ui-corner-all">
        <ItemTemplate>
            <span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
            <%# Eval("Text") %>
        </ItemTemplate>
        <Items>
            <DotNetAge:SimpleListItem Text="Can be dropped.." />
            <DotNetAge:SimpleListItem Text="..on an empty list" />
            <DotNetAge:SimpleListItem Text="Item3" />
            <DotNetAge:SimpleListItem Text="Item4" />
            <DotNetAge:SimpleListItem Text="Item5" />
            <DotNetAge:SimpleListItem Text="Item6" />
        </Items>
    </DotNetAge:SimpleListView>
    <DotNetAge:SimpleListView ID="SimpleListView2" runat="server" CssClass="ui-helper-reset ui-widget-content sortable ui-corner-all"
        ItemCssClass="ui-helper-reset ui-state-highlight ui-corner-all">
        <ItemTemplate>
            <span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
            <%# Eval("Text") %>
        </ItemTemplate>
        <Items>
            <DotNetAge:SimpleListItem Text="Cannot be dropped.." />
            <DotNetAge:SimpleListItem Text="..on an empty list" />
            <DotNetAge:SimpleListItem Text="Item3" />
            <DotNetAge:SimpleListItem Text="Item4" />
            <DotNetAge:SimpleListItem Text="Item5" />
            <DotNetAge:SimpleListItem Text="Item6" />
        </Items>
    </DotNetAge:SimpleListView>
    <DotNetAge:SimpleListView ID="SimpleListView3" runat="server" CssClass="ui-helper-reset ui-widget-content sortable ui-corner-all"
        ItemCssClass="ui-helper-reset ui-state-highlight ui-corner-all">
        <ItemTemplate>
            <span class="ui-icon ui-icon-arrowthick-2-n-s"></span>
            <%# Eval("Text") %>
        </ItemTemplate>
    </DotNetAge:SimpleListView>
    <DotNetAge:Sortable ID="Sortable1" runat="server">
        <Target TargetIDs="SimpleListView1,SimpleListView3" />
        <ConnectWith Selector="ul" />
    </DotNetAge:Sortable>
    <DotNetAge:Sortable ID="Sortable2" runat="server" AllowDropOnEmpty="false">
        <Target TargetIDs="SimpleListView2" />
        <ConnectWith Selector="ul" />
    </DotNetAge:Sortable>
    <div style="clear: left; margin-top: 5px;">
    </div>
    <br />
    <demo:Code runat="server" ID="codeView" SourceFile="~/Sortable/Codes/HandleEmptyList.aspx" />
</asp:Content>
